import sys
from PyQt5.QtWidgets import (
    QTextEdit,
    QApplication,
    QMainWindow,
    QPushButton,
    QLabel,
    QWidget,
)
from PyQt5.QtCore import pyqtSlot
from PyQt5.QtGui import QPixmap


def main():
    app = QApplication(sys.argv)
    # create window

    window = QMainWindow()
    window.setWindowTitle("Hello World")
    window.resize(1400, 1400)
    # fixed size
    # window.setFixedHeight(400)
    # window.setFixedWidth(400)
    label = QLabel("Hello World", window)
    button = QPushButton("Click me", window)
    pic_label = QLabel(window)
    pic = QPixmap("pic.png")
    pic_label.setPixmap(pic)
    pic_label.resize(pic.width(), pic.height())
    pic_label.move(10, 10)
    contentEdit = QTextEdit(window)
    contentEdit.setFixedHeight(200)
    contentEdit.setFixedWidth(100)
    pic_label.move(510, 150)
    contentEdit.move(10, 100)
    # button.clicked.connect(lambda: button_clicked(label))
    # button.clicked.connect(lambda: label.setText("Button clicked"))
    window.show()

    sys.exit(app.exec_())


def button_clicked(label):
    print("Button clicked")
    label.setText("Button clicked")


@pyqtSlot()
def on_button_clicked():
    print("Button clicked")


if __name__ == "__main__":
    main()
